/**
 * @file TcpApp_server_transport.h
 * @brief Transport protocol abstraction layer
 * @Author: aple
 * @Date: 2025-9-27 9:20:10
 * @LastEditors: aple
 * @LastEditTime: 2025-9-27 18:37:50
 * @Verision: 1.0.0.0
 **/

#ifndef _TCP_APP_SERVER_TRANSPORT_H
#define _TCP_APP_SERVER_TRANSPORT_H

// Dependencies
#include "core/net.h"
#include "server/tcp_server_app_common.h"

// C++ guard
#ifdef __cplusplus
extern "C"
{
#endif

   // TcpApp/TCP server related functions
   void TcpAppServerAcceptConnection(TcpAppServerContext *context);

   error_t TcpAppServerShutdownConnection(TcpAppClientConnection *connection);
   void TcpAppServerCloseConnection(TcpAppClientConnection *connection);

   error_t TcpAppServerSendData(TcpAppClientConnection *connection, const void *data,
                                size_t length, size_t *written, uint_t flags);

   error_t TcpAppServerReceiveData(TcpAppClientConnection *connection, void *data,
                                   size_t size, size_t *received, uint_t flags);

// C++ guard
#ifdef __cplusplus
}
#endif

#endif
